import { HttpModule } from '@angular/http';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { DashBoardComponent } from './dash-board/dash-board.component';
import { RouterModule, Routes } from '@angular/router';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { HeaderComponent } from './header/header.component';
import { MenuComponent } from './menu/menu.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { FooterComponent } from './footer/footer.component';
import { MainContentComponent } from './main-content/main-content.component';
import { StockMangerComponent } from './stock/stock-manger/stock-manger.component';
import { StarsComponent } from './stars/stars.component';
import { StockFormComponent } from './stock/stock-form/stock-form.component';
import { StockService } from "./stock/stock.service";
import { StockFilterPipe } from './stock/stock-filter.pipe';
import { WebsocketService } from "./shared/websocket.service";
import { SearchFormComponent } from "./stock/search-form/search-form.component";

const routeConfig: Routes = [
  { path: '', redirectTo: 'dashboard', pathMatch: 'full' },
  { path: 'stock', component: StockMangerComponent },
  { path: 'stock/:id', component: StockFormComponent },
  { path: 'dashboard', component: DashBoardComponent }
]

@NgModule({
  declarations: [
    AppComponent,
    HeaderComponent,
    MenuComponent,
    SidebarComponent,
    FooterComponent,
    MainContentComponent,
    StockMangerComponent,
    StarsComponent,
    DashBoardComponent,
    StockFormComponent,
    StockFilterPipe,
    SearchFormComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    HttpModule,
    RouterModule.forRoot(routeConfig)
  ],
  providers: [StockService, WebsocketService],
  bootstrap: [AppComponent]
})
export class AppModule { }
